import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

//依赖分析图示的插件。
import { visualizer } from "rollup-plugin-visualizer";

//cdn管理插件。
import vueRefresh from "@vitejs/plugin-vue";
import { autoComplete, Plugin as importToCDN } from 'vite-plugin-cdn-import';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),

    //依赖分析插件的方法。
    visualizer({
      emitFile: false,
      filename:"stats.html", //分析图生成的文件名
      open:true //如果存在本地服务端口，将在打包后自动展示
    }),

    
  ],
})
